package org.luxor.commons.swagger.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Swagger 扩展配置
 *
 * @author Mr.yan @date 2020/2/16
 */
@ConfigurationProperties(prefix = SwaggerProperties.PREFIX)
public class SwaggerProperties {
    public static final String PREFIX = "spring.swagger";

    private static final Boolean DEFAULT_ENABLE = Boolean.TRUE;
    private static final Boolean DEFAULT_API_VERSION_ENABLE = Boolean.FALSE;
    private static final String DEFAULT_TITLE = "接口文档";
    private static final String DEFAULT_DESCRIPTION = "金字塔网络科技公司";
    private static final String DEFAULT_TERMS_OF_SERVICE_URL = "https://www.luxor-cms.cn/";

    /**
     * 启动Swagger功能？
     */
    private Boolean enabled;

    /**
     * 启动接口多版本号功能?
     */
    private Boolean apiVersionEnable;

    /**
     * 接口版本
     */
    private double apiVersion;

    /**
     * Swagger接口文档标题
     */
    private String title;
    /**
     * Swagger接口文档详细说明
     */
    private String description;

    /**
     * Swagger所属服务访问地址
     */
    private String termsOfServiceUrl;

    public SwaggerProperties() {
        this.enabled = DEFAULT_ENABLE.booleanValue();
        this.apiVersionEnable = DEFAULT_API_VERSION_ENABLE.booleanValue();
        this.apiVersion = 1.0;
        this.title = DEFAULT_TITLE;
        this.description = DEFAULT_DESCRIPTION;
        this.termsOfServiceUrl = DEFAULT_TERMS_OF_SERVICE_URL;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean getApiVersionEnable() {
        return apiVersionEnable;
    }

    public void setApiVersionEnable(Boolean apiVersionEnable) {
        this.apiVersionEnable = apiVersionEnable;
    }

    public double getApiVersion() {
        return apiVersion;
    }

    public void setApiVersion(double apiVersion) {
        this.apiVersion = apiVersion;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTermsOfServiceUrl() {
        return termsOfServiceUrl;
    }

    public void setTermsOfServiceUrl(String termsOfServiceUrl) {
        this.termsOfServiceUrl = termsOfServiceUrl;
    }
}
